<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Unit Test: HTTP Module</title>
    <script type="text/javascript" src="../../scripts/dd/dd.js"></script>
    <script type="text/javascript">
    dd({
        debug: true,
        modules: [
            "http"
        ]
    });
    dd(function()
    {
        // Get
        dd.http({
            url:"echo.php",
            get:{foo:"bar"},
            success:function()
            {
                dd.log("Method = GET, Get = { foo: 'bar' }");
                dd.log(this.json.get, dd.log.responseSuccess);
            }
        });
        // Post
        dd.http({
            url:"echo.php",
            get:{foo:"bar"},
            post:{hello:"world"},
            success:function()
            {
                dd.log("Method = POST, Get = { foo: 'bar' }, Post = { hello: 'world' }");
                dd.log(this.json.get, dd.log.responseSuccess);
                dd.log(this.json.data, dd.log.responseSuccess);
            }
        });
        // Put
        dd.http({
            url:"echo.php",
            type:"PUT",
            get:{foo:"bar"},
            post:{hello:"world"},
            success:function()
            {
                dd.log("Method = PUT, Get = { foo: 'bar' }, Post = { hello: 'world' }");
                dd.log(this.json.get, dd.log.responseSuccess);
                dd.log(this.json.data, dd.log.responseSuccess);
            }
        });
        // Delete
        dd.http({
            url:"echo.php",
            type:"DELETE",
            get:{foo:"bar"},
            success:function()
            {
                dd.log("Method = DELETE, Get = { foo: 'bar' }, Post = { hello: 'world' }");
                dd.log(this.json.get, dd.log.responseSuccess);
            }
        });
    });
    </script>
</head>
<body>
    Loading...
</body>
</html>
